home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / OOP_Course / Labs / Stack / Stack.m < prev    next >
Text File  |  1992-12-19  |  591b  |  40 lines

  1. /*Objective_C Implementation of the Stack Class: Stack.m*/
  2.  
  3. //EXERCISE:    COMPLETE THE  PUSH, POP, TOP, AND PRINTSTACK METHODS
  4.  
  5. #import <stdio.h>
  6. #import "Stack.h"
  7.  
  8. @implementation Stack
  9.  
  10. //Initialize a Stack instance of floating point elements
  11. -init
  12. {
  13.     return [self initCount:0 elementSize:sizeof(float) description:"f"];
  14.                                  //return id of newly created Stack instance
  15. }                                                                       
  16. //Add an element to the stack
  17. -push: (float)aNumber
  18. {
  19.  
  20. }
  21.  
  22. //Remove an element from the stack
  23. -(float)pop
  24. {
  25.  
  26. }
  27.  
  28. -(float)top
  29. {
  30.  
  31. }
  32.  
  33. //Print the elements on the stack
  34. -printStack
  35. {
  36.  
  37. }
  38.  
  39. @end
  40.